package com.example.mybatisplus.controller;

import com.example.mybatisplus.entity.FmCustomer;
import com.example.mybatisplus.service.CustomerService;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PutMapping;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;
import java.util.Objects;

@RestController
@RequestMapping("customer")
@RequiredArgsConstructor
public class CustomerController {
    private final CustomerService customerService;

    @GetMapping
    public List<FmCustomer> list1() {
        return customerService.customerListAll();
    }

    @GetMapping("/list2")
    public List<FmCustomer> list2() {
        return customerService.customerListAll2();
    }

    @GetMapping("/list3")
    public Object list3() {
        return customerService.customerListAll3();
    }

    @PutMapping
    public void update() {
        customerService.updateNew();
    }
}
